public class ViewEmployeeInfo {

    public ViewEmployeeInfo(listOfEmployeeController controller) {
        soqlAccount = 'SELECT Id, FirstName, LastName, Salutation, Height__c, Weight__c, PersonEmail, CurrencyIsoCode, Birthdate__c, Willing_to_travel__c, Marital_status__c, States_where_I_have_family__c, isPersonAccount, Who_cares_them__c, BillingStreet, BillingCity, BillingState, BillingPostalCode, AccountNumber, Position__r.Name, Current_Store__r.Name, Join_date__c, Coat__c, Vest__c, Pants__c, Shirt__c, Face_Photo_ID__c, Body_Photo_ID__c FROM Account WHERE id = \'001L0000005XRanIAG\'';
        employeeQuery();
    }


    private String soqlAccount {get;set;}
    public List<Account> employeeAccount{get;set;}
    
    public PageReference employeeSearch() {
        String idEmployee= Apexpages.currentPage().getParameters().get('idEmployee');
        soqlAccount = 'SELECT Id, FirstName, LastName, Salutation, Height__c, Weight__c, PersonEmail, CurrencyIsoCode, Birthdate__c, Willing_to_travel__c, Marital_status__c, States_where_I_have_family__c, isPersonAccount, Who_cares_them__c, BillingStreet, BillingCity, BillingState, BillingPostalCode, AccountNumber, Position__r.Name, Current_Store__r.Name, Join_date__c, Coat__c, Vest__c, Pants__c, Shirt__c, Face_Photo_ID__c, Body_Photo_ID__c FROM Account';
        if (!idEmployee.equals('')) { soqlAccount += ' WHERE id = \''+idEmployee+'\''; }
        soqlAccount += 'LIMIT 1';

        // run the query again
        employeeQuery();
        return null;
    }
    
    public void employeeQuery() {
        try {
            employeeAccount = Database.query(soqlAccount + ' ORDER BY Join_date__c DESC');           
        } catch (Exception e) {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
        
        } 
    }
}